import logging,pytest,os,yamail
def log():
    logging.basicConfig(level=logging.DEBUG,filemode='w',filename='mzy.log',format='%(filename)s %(module)s %(asctime)s %(lineno)d')
def yj(f):
    a=yamail.SMTP(user='1391277593@qq.com',password='npphtjsegwjqhiae',host='smtp.qq.com')
    a.send(to='1391277593@qq.com',subject='标题',contents='内容',attachments=f)
if __name__ == '__main__':
    log()
    pytest.main(['Test.py','-s','--html=./allure'])
    os.system('allure generate ./allure -0 ./allure-html --clean')
    yj(['mzy.log'])